package com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dao.impl.NewsDaoImpl;
import com.model.Astuff;
import com.model.Newitem;
import com.service.NewsManager;

@Component("newsManager")
public class NewsManagerImpl implements NewsManager {
	private NewsDaoImpl newsDao;

	public Newitem getNewsById(int itemid) {
		return newsDao.getNewsById(itemid);
	}

	public NewsDaoImpl getNewsDao() {
		return newsDao;
	}

	@Resource
	public void setNewsDao(NewsDaoImpl newsDao) {
		this.newsDao = newsDao;
	}

	public List<Newitem> getNewsListByUser(Astuff astuff, int offset, int length) {
		return newsDao.getNewsListByUser(astuff, offset, length);
	}

	public Long getNewsCountByUser(Astuff astuff) {
		return newsDao.getNewsCountByUser(astuff);
	}

	public Long getUnReadNewsCountByUser(Astuff astuff) {
		return newsDao.getUnReadNewsCountByUser(astuff);
	}

	public List<Newitem> getUnReadNewsListByUser(Astuff astuff, int offset,
			int length) {
		return newsDao.getUnReadNewsListByUser(astuff, offset, length);
	}

	public void setNewsReaded(Astuff astuff, int itemid) {
		newsDao.setNewsReaded(astuff, itemid);
	}

}
